<%@ page language="java" contentType="text/html; charset=GB18030"
	pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%
String world = request.getParameter("world");
try {
	String url = "jdbc:mysql://localhost:3306/demo";
	Class.forName("com.mysql.jdbc.Driver");
	Connection conn = DriverManager.getConnection(url, "root", "123");
	Statement stm = conn.createStatement();
	String sql = "select * from user where username like '%"+world+"%'";
	ResultSet rs = stm.executeQuery(sql);
	while (rs.next()) {
		String id = rs.getString("id");
		String username = rs.getString("username");
		String password = rs.getString("password");
		String email = rs.getString("email");
		out.println(id + "\t" + username + "\t" + password
				+ "\t" + email + "<br>");
	}
	rs.close();
	stm.close();
	conn.close();
} catch (Exception e) {
	e.printStackTrace();
}
%>
</body>
</html>